<template>
  <div>
    <el-option v-for="item in allUsers" :label="item.label" :value="item.value" :key="item.value"></el-option>
  </div>
</template>

<script>
import { userPage } from '@/api/usrs/index'
export default {
  name: 'userOption',
  data() {
    return {
      allUsers: [],
    }
  },
  mounted() {
    this.getAllUser()
  },
  methods: {
    getAllUser() {
      let params = { pageNum: 1, pageSize: 9999}
      userPage(params).then(res => {
        const { data } = res
        this.allUsers = data.list.map(item=> { return {value: item.id, label: item.name} } )
      })
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
